package sk.project.accounting.data.model;

// Generated Dec 17, 2012 9:50:06 PM by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Company generated by hbm2java
 */
@Entity
@Table(name = "company", catalog = "skl_hosp_new")
public class Company implements java.io.Serializable {

	private Integer id;
	private User user;
	private Address address;
	private String name;
	private String icdph;
	private String ico;
	private String dic;
	private Set<BranchOffice> branchOffices = new HashSet<BranchOffice>(0);

	public Company() {
	}

	public Company(String name) {
		this.name = name;
	}

	public Company(User user, Address address, String name, String icdph,
			String ico, String dic, Set<BranchOffice> branchOffices) {
		this.user = user;
		this.address = address;
		this.name = name;
		this.icdph = icdph;
		this.ico = ico;
		this.dic = dic;
		this.branchOffices = branchOffices;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_user")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_address")
	public Address getAddress() {
		return this.address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}

	@Column(name = "name", nullable = false, length = 100)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "icdph", length = 12)
	public String getIcdph() {
		return this.icdph;
	}

	public void setIcdph(String icdph) {
		this.icdph = icdph;
	}

	@Column(name = "ico", length = 8)
	public String getIco() {
		return this.ico;
	}

	public void setIco(String ico) {
		this.ico = ico;
	}

	@Column(name = "dic", length = 10)
	public String getDic() {
		return this.dic;
	}

	public void setDic(String dic) {
		this.dic = dic;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "company")
	public Set<BranchOffice> getBranchOffices() {
		return this.branchOffices;
	}

	public void setBranchOffices(Set<BranchOffice> branchOffices) {
		this.branchOffices = branchOffices;
	}

}
